package com.role.worlds
{
	import com.role.entities.PlayerEntity;
	import com.saia.starlingPunk.SP;
	import com.saia.starlingPunk.SPWorld;
	
	import flash.display.BitmapData;
	
	import starling.display.Image;
	import starling.textures.Texture;


	public class PlayWorld extends SPWorld
	{
		private var _player:PlayerEntity;
		
		public function PlayWorld()
		{
		}
		
		override public function begin() : void
		{
			super.begin();
			createBgFill();
			
			_player = new PlayerEntity();
			add(_player);
		}
		
		private function createBgFill() : void
		{
			var bgColor:uint = 0xff171b26;
			var bmpData:BitmapData = new BitmapData(SP.width, SP.height, false, bgColor);
			var image:Image = new Image(Texture.fromBitmapData(bmpData));
			addChild(image);
		}
		
		override public function end() : void
		{
			super.end();
			removeAll();
		}
		
		override public function update() : void
		{
			super.update();
		}
	}
}